package com.guigu.yh.springcloud.service.impl;

import com.guigu.yh.springcloud.entities.Payment;
import com.guigu.yh.springcloud.mapper.PaymentMapper;
import com.guigu.yh.springcloud.service.PaymentService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * 付款服务实现
 *
 * @author zyh
 * @version 1.0.0
 * @date 2022/09/01
 */
@Service
public class PaymentServiceImpl implements PaymentService {

    @Resource
    private PaymentMapper paymentMapper;

    /**
     * 创建
     *
     * @param payment 付款
     * @return int
     */
    @Override
    public int create(Payment payment) {
        return paymentMapper.create(payment);
    }

    /**
     * 通过id获取付款
     *
     * @param id id
     * @return {@link Payment}
     */
    @Override
    public Payment getPaymentById(Long id) {
        return paymentMapper.getPaymentById(id);
    }
}
